<?php

  session_start();
  include "config.php";

  if(isset($_SESSION["user"]))
  {
    if(isset($_SESSION["orderedSuccess"]))
    {
      include "$header";
      include "$body";

      if(isset($_POST["OK"]))
      {
        if(isset($_SESSION["c_no"]))
          unset($_SESSION["c_no"]);

        if(isset($_SESSION["o_confirmed"]))
          unset($_SESSION["o_confirmed"]);

        if(isset($_SESSION["o_alternate"]))
          unset($_SESSION["o_alternate"]);
    
        if(isset($_SESSION["o_products"]))
          unset($_SESSION["o_products"]);
 
        if(isset($_SESSION["o_freight"]))
          unset($_SESSION["o_freight"]);
 
        if(isset($_SESSION["o_merchanise"]))
          unset($_SESSION["o_merchanise"]);
    
        if(isset($_SESSION["o_delivery"]))
          unset($_SESSION["o_delivery"]);
 
        if(isset($_SESSION["o_insurance"]))
          unset($_SESSION["o_insurance"]);
    
        if(isset($_SESSION["o_total"]))
          unset($_SESSION["o_total"]);

        if(isset($_SESSION["o_payment"]))
          unset($_SESSION["o_payment"]);
 
        if(isset($_SESSION["o_card"]))
          unset($_SESSION["o_card"]);

        if(isset($_SESSION["orderID"]))
          unset($_SESSION["orderID"]);

        if(isset($_SESSION["orderedSuccess"]))
          unset($_SESSION["orderedSuccess"]);

        echo "<SCRIPT language='Javascript'>";
        echo "  window.location.href = 'main.php';";
        echo "</SCRIPT>";
      }
      else
      {
?>

<div style="position:absolute; top:0px; left:1px; border:0;">
  <span class="prevPage">Order Products:Search > </span>
  <span class="prevPage">Confirm Customer Details > </span>
  <span class="prevPage">Order Products > </span>
  <span class="prevPage">Confirm Order > </span>
  <span class="page">Success</span>
</div>
  
<?php

      include "$H_op";

?>

<p>

Order No. [<b><?php echo $_SESSION["orderID"]; ?></b>] has been successfully fowarded. 

<p>

<FORM name="ok" action="" method="post">
<input class="submit_off" type="submit" value="OK" name="OK" onmouseover="className='submit_on'" onmouseout="className='submit_off'" />
</FORM>

</BODY>

<?php

      }
      include "$footer";

    }
    else
    {
      echo "<SCRIPT language='Javascript'>";
      echo "  window.location.href = 'orderProducts.php';";
      echo "</SCRIPT>";
    }
  }
  else
  {
    session_destroy();
    echo "<SCRIPT language='Javascript'>";
    echo "  parent.window.location.href = 'index.php';";
    echo "</SCRIPT>";
  }

?>